xenpaging: print info when free request slots drop below 2
authorKeir Fraser <keir@xen.org>
Fri, 26 Nov 2010 14:19:09 +0000 (14:19 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 26 Nov 2010 14:19:09 +0000 (14:19 +0000)
Add debugging aid to free request slots in the ring buffer.
It should not happen that the ring gets full, print info anyway if it
happens.

Signed-off-by: Olaf Hering <olaf@aepfle.de>
xen/arch/x86/mm/mem_event.c

index 5187a72a6cf08b973c543d672321f8c13c5f54cb..83b76d5f9fc11a40d427fbc6850816bcf84f6315 100644 (file)
@@ -152,6 +152,11 @@ int mem_event_check_ring(struct domain *d)
     mem_event_ring_lock(d);
 
     free_requests = RING_FREE_REQUESTS(&d->mem_event.front_ring);
+    if ( unlikely(free_requests < 2) )
+    {
+        gdprintk(XENLOG_INFO, "free request slots: %d\n", free_requests);
+        WARN_ON(free_requests == 0);
+    }
     ring_full = free_requests < MEM_EVENT_RING_THRESHOLD;
 
     if ( (curr->domain->domain_id == d->domain_id) && ring_full )